3.68 \(\int \frac {1+x^2}{1+b x^2+x^4} \, dx\)

Optimal. Leaf size=62 \[ \frac {\tan ^{-1}\left (\frac {\sqrt {2-b}+2 x}{\sqrt {b+2}}\right )}{\sqrt {b+2}}-\frac {\tan ^{-1}\left (\frac {\sqrt {2-b}-2 x}{\sqrt {b+2}}\right )}{\sqrt {b+2}} \]

[Out]

-arctan((-2*x+(2-b)^(1/2))/(2+b)^(1/2))/(2+b)^(1/2)+arctan((2*x+(2-b)^(1/2))/(2+b)^(1/2))/(2+b)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1161, 618, 204} \[ \frac {\tan ^{-1}\left (\frac {\sqrt {2-b}+2 x}{\sqrt {b+2}}\right )}{\sqrt {b+2}}-\frac {\tan ^{-1}\left (\frac {\sqrt {2-b}-2 x}{\sqrt {b+2}}\right )}{\sqrt {b+2}} \]

Antiderivative was successfully verified.

[In]

Int[(1 + x^2)/(1 + b*x^2 + x^4),x]

[Out]

-(ArcTan[(Sqrt[2 - b] - 2*x)/Sqrt[2 + b]]/Sqrt[2 + b]) + ArcTan[(Sqrt[2 - b] + 2*x)/Sqrt[2 + b]]/Sqrt[2 + b]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1161

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(2*d)/e - b/c, 2]},
Dist[e/(2*c), Int[1/Simp[d/e + q*x + x^2, x], x], x] + Dist[e/(2*c), Int[1/Simp[d/e - q*x + x^2, x], x], x]] /
; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - a*e^2, 0] && (GtQ[(2*d)/e - b/c, 0] || ( !Lt
Q[(2*d)/e - b/c, 0] && EqQ[d - e*Rt[a/c, 2], 0]))

Rubi steps

\begin {align*} \int \frac {1+x^2}{1+b x^2+x^4} \, dx &=\frac {1}{2} \int \frac {1}{1-\sqrt {2-b} x+x^2} \, dx+\frac {1}{2} \int \frac {1}{1+\sqrt {2-b} x+x^2} \, dx\\ &=-\operatorname {Subst}\left (\int \frac {1}{-2-b-x^2} \, dx,x,-\sqrt {2-b}+2 x\right )-\operatorname {Subst}\left (\int \frac {1}{-2-b-x^2} \, dx,x,\sqrt {2-b}+2 x\right )\\ &=\frac {\tan ^{-1}\left (\frac {-\sqrt {2-b}+2 x}{\sqrt {2+b}}\right )}{\sqrt {2+b}}+\frac {\tan ^{-1}\left (\frac {\sqrt {2-b}+2 x}{\sqrt {2+b}}\right )}{\sqrt {2+b}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 124, normalized size = 2.00 \[ \frac {\frac {\left (\sqrt {b^2-4}-b+2\right ) \tan ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {b-\sqrt {b^2-4}}}\right )}{\sqrt {b-\sqrt {b^2-4}}}+\frac {\left (\sqrt {b^2-4}+b-2\right ) \tan ^{-1}\left (\frac {\sqrt {2} x}{\sqrt {\sqrt {b^2-4}+b}}\right )}{\sqrt {\sqrt {b^2-4}+b}}}{\sqrt {2} \sqrt {b^2-4}} \]

Antiderivative was successfully verified.

[In]

Integrate[(1 + x^2)/(1 + b*x^2 + x^4),x]

[Out]

(((2 - b + Sqrt[-4 + b^2])*ArcTan[(Sqrt[2]*x)/Sqrt[b - Sqrt[-4 + b^2]]])/Sqrt[b - Sqrt[-4 + b^2]] + ((-2 + b +
 Sqrt[-4 + b^2])*ArcTan[(Sqrt[2]*x)/Sqrt[b + Sqrt[-4 + b^2]]])/Sqrt[b + Sqrt[-4 + b^2]])/(Sqrt[2]*Sqrt[-4 + b^
2])

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 101, normalized size = 1.63 \[ \left [-\frac {\sqrt {-b - 2} \log \left (\frac {x^{4} - {\left (b + 4\right )} x^{2} - 2 \, {\left (x^{3} - x\right )} \sqrt {-b - 2} + 1}{x^{4} + b x^{2} + 1}\right )}{2 \, {\left (b + 2\right )}}, \frac {\sqrt {b + 2} \arctan \left (\frac {x^{3} + {\left (b + 1\right )} x}{\sqrt {b + 2}}\right ) + \sqrt {b + 2} \arctan \left (\frac {x}{\sqrt {b + 2}}\right )}{b + 2}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4+b*x^2+1),x, algorithm="fricas")

[Out]

[-1/2*sqrt(-b - 2)*log((x^4 - (b + 4)*x^2 - 2*(x^3 - x)*sqrt(-b - 2) + 1)/(x^4 + b*x^2 + 1))/(b + 2), (sqrt(b
+ 2)*arctan((x^3 + (b + 1)*x)/sqrt(b + 2)) + sqrt(b + 2)*arctan(x/sqrt(b + 2)))/(b + 2)]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4+b*x^2+1),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, need to choose a branch for the root of a polynomial with parameters. This might be wrong.The choice was
done assuming [b]=[0]Precision problem choosing root in common_EXT, current precision 14Warning, need to choos
e a branch for the root of a polynomial with parameters. This might be wrong.The choice was done assuming [b]=
[0]Precision problem choosing root in common_EXT, current precision 14Undef/Unsigned Inf encountered in limitL
imit: Max order reached or unable to make series expansion Error: Bad Argument Value

________________________________________________________________________________________

maple [B]  time = 0.04, size = 277, normalized size = 4.47 \[ -\frac {b \arctan \left (\frac {2 x}{\sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {\left (b -2\right ) \left (b +2\right )}\, \sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}+\frac {b \arctan \left (\frac {2 x}{\sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {\left (b -2\right ) \left (b +2\right )}\, \sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}+\frac {2 \arctan \left (\frac {2 x}{\sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {\left (b -2\right ) \left (b +2\right )}\, \sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}+\frac {\arctan \left (\frac {2 x}{\sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {2 b -2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}-\frac {2 \arctan \left (\frac {2 x}{\sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {\left (b -2\right ) \left (b +2\right )}\, \sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}+\frac {\arctan \left (\frac {2 x}{\sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}}\right )}{\sqrt {2 b +2 \sqrt {\left (b -2\right ) \left (b +2\right )}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+1)/(x^4+b*x^2+1),x)

[Out]

-2/((b-2)*(2+b))^(1/2)/(2*((b-2)*(2+b))^(1/2)+2*b)^(1/2)*arctan(2*x/(2*((b-2)*(2+b))^(1/2)+2*b)^(1/2))+1/(2*((
b-2)*(2+b))^(1/2)+2*b)^(1/2)*arctan(2*x/(2*((b-2)*(2+b))^(1/2)+2*b)^(1/2))+1/((b-2)*(2+b))^(1/2)/(2*((b-2)*(2+
b))^(1/2)+2*b)^(1/2)*arctan(2*x/(2*((b-2)*(2+b))^(1/2)+2*b)^(1/2))*b+2/((b-2)*(2+b))^(1/2)/(-2*((b-2)*(2+b))^(
1/2)+2*b)^(1/2)*arctan(2*x/(-2*((b-2)*(2+b))^(1/2)+2*b)^(1/2))+1/(-2*((b-2)*(2+b))^(1/2)+2*b)^(1/2)*arctan(2*x
/(-2*((b-2)*(2+b))^(1/2)+2*b)^(1/2))-1/((b-2)*(2+b))^(1/2)/(-2*((b-2)*(2+b))^(1/2)+2*b)^(1/2)*arctan(2*x/(-2*(
(b-2)*(2+b))^(1/2)+2*b)^(1/2))*b

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2} + 1}{x^{4} + b x^{2} + 1}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+1)/(x^4+b*x^2+1),x, algorithm="maxima")

[Out]

integrate((x^2 + 1)/(x^4 + b*x^2 + 1), x)

________________________________________________________________________________________

mupad [B]  time = 0.06, size = 73, normalized size = 1.18 \[ \frac {\mathrm {atan}\left (\frac {x}{\sqrt {b+2}}\right )+\mathrm {atan}\left (\left (b+2\right )\,\left (x\,\left (\frac {1}{\sqrt {b+2}}+\frac {\frac {4}{b+2}-1}{\left (b-2\right )\,\sqrt {b+2}}\right )+\frac {x^3\,\left (\frac {2\,b}{b+2}-1\right )}{\left (b-2\right )\,\sqrt {b+2}}\right )\right )}{\sqrt {b+2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 + 1)/(b*x^2 + x^4 + 1),x)

[Out]

(atan(x/(b + 2)^(1/2)) + atan((b + 2)*(x*(1/(b + 2)^(1/2) + (4/(b + 2) - 1)/((b - 2)*(b + 2)^(1/2))) + (x^3*((
2*b)/(b + 2) - 1))/((b - 2)*(b + 2)^(1/2)))))/(b + 2)^(1/2)

________________________________________________________________________________________

sympy [A]  time = 0.38, size = 88, normalized size = 1.42 \[ - \frac {\sqrt {- \frac {1}{b + 2}} \log {\left (x^{2} + x \left (- b \sqrt {- \frac {1}{b + 2}} - 2 \sqrt {- \frac {1}{b + 2}}\right ) - 1 \right )}}{2} + \frac {\sqrt {- \frac {1}{b + 2}} \log {\left (x^{2} + x \left (b \sqrt {- \frac {1}{b + 2}} + 2 \sqrt {- \frac {1}{b + 2}}\right ) - 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+1)/(x**4+b*x**2+1),x)

[Out]

-sqrt(-1/(b + 2))*log(x**2 + x*(-b*sqrt(-1/(b + 2)) - 2*sqrt(-1/(b + 2))) - 1)/2 + sqrt(-1/(b + 2))*log(x**2 +
 x*(b*sqrt(-1/(b + 2)) + 2*sqrt(-1/(b + 2))) - 1)/2

________________________________________________________________________________________